home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.plaf.basic;
-
- import java.awt.Component;
- import java.awt.Dimension;
- import java.awt.Frame;
- import java.awt.Window;
- import javax.swing.JComponent;
- import javax.swing.JPopupMenu;
- import javax.swing.LookAndFeel;
- import javax.swing.plaf.ComponentUI;
- import javax.swing.plaf.PopupMenuUI;
- import javax.swing.plaf.UIResource;
-
- public class BasicPopupMenuUI extends PopupMenuUI {
- protected JPopupMenu popupMenu = null;
- private Frame frame;
- private static transient MouseGrabber mouseGrabber = null;
-
- // $FF: synthetic method
- static Window access$0(Component var0) {
- return getWindow(var0);
- }
-
- public static ComponentUI createUI(JComponent var0) {
- return new BasicPopupMenuUI();
- }
-
- public Dimension getMaximumSize(JComponent var1) {
- return this.getPreferredSize(var1);
- }
-
- public Dimension getMinimumSize(JComponent var1) {
- return this.getPreferredSize(var1);
- }
-
- public Dimension getPreferredSize(JComponent var1) {
- return null;
- }
-
- private static Window getWindow(Component var0) {
- Object var1;
- for(var1 = var0; !(var1 instanceof Window) && var1 != null; var1 = ((Component)var1).getParent()) {
- }
-
- return (Window)var1;
- }
-
- public void installDefaults() {
- if (this.popupMenu.getLayout() == null || this.popupMenu.getLayout() instanceof UIResource) {
- this.popupMenu.setLayout(new DefaultMenuLayout(this.popupMenu, 1));
- }
-
- this.popupMenu.setOpaque(true);
- LookAndFeel.installBorder(this.popupMenu, "PopupMenu.border");
- LookAndFeel.installColorsAndFont(this.popupMenu, "PopupMenu.background", "PopupMenu.foreground", "PopupMenu.font");
- }
-
- protected void installKeyboardActions() {
- }
-
- protected void installListeners() {
- if (mouseGrabber == null) {
- mouseGrabber = new MouseGrabber();
- }
-
- }
-
- public void installUI(JComponent var1) {
- this.popupMenu = (JPopupMenu)var1;
- this.installDefaults();
- this.installListeners();
- this.installKeyboardActions();
- }
-
- protected void uninstallDefaults() {
- LookAndFeel.uninstallBorder(this.popupMenu);
- }
-
- protected void uninstallKeyboardActions() {
- }
-
- protected void uninstallListeners() {
- }
-
- public void uninstallUI(JComponent var1) {
- this.uninstallDefaults();
- this.uninstallListeners();
- this.uninstallKeyboardActions();
- this.popupMenu = null;
- }
- }
-